% given values
function [x y]=f_plot_spiral(center,pos,nturns,r)

% engine
% dp = diff(pos,1,1) 
% R = hypot(dp(1), dp(2)) ;
% phi0 = atan2(dp(2), dp(1)) 
phi0 = atan2(pos(1,2), pos(1,1)) ;
phi = linspace(0, nturns*2*pi, length(r)) ; % 10000 = resolution
% r = linspace(0, R, numel(phi)) ;
final_phase = phi + phi0;
% final_phase(1:5)
x = center(1) + r .* cos(final_phase) ;
y = center(2) + r  .* sin(final_phase) ;
% pause